#ifndef __IMAGEMATCH_H__
#define __IMAGEMATCH_H__

#include <map>
#include <vector>
#include <boost/smart_ptr.hpp>

struct CvMat;
namespace cshotel {
    class InputImage;
    class ImageFeature;
    
    class ImageMatch {
    public:
        ImageMatch(boost::weak_ptr<InputImage> first, boost::weak_ptr<InputImage> second);
        ~ImageMatch();
        void doRANSAC();
        bool doProbabilisticCheck();
        CvMat* getTransformationMatrix();
        std::vector<boost::weak_ptr<ImageFeature> >& getInliers();
        std::vector<boost::weak_ptr<ImageFeature> >& getOutliers();
        std::map<boost::weak_ptr<ImageFeature>, boost::weak_ptr<ImageFeature> >& getFeatureMatches();
        boost::weak_ptr<InputImage> getFirstImage();
        boost::weak_ptr<InputImage> getSecondImage();
        void writeDebugImages();
        
    private:
        boost::weak_ptr<InputImage> firstImage, secondImage;
        std::map<boost::weak_ptr<ImageFeature>, boost::weak_ptr<ImageFeature> > featureMatches;
        std::vector<boost::weak_ptr<ImageFeature> > inliers;
        std::vector<boost::weak_ptr<ImageFeature> > outliers;
        CvMat* transformationMatrix;
    };
}

#endif
